import { configureStore } from '@reduxjs/toolkit'
import userReducer from './user-reducer'
import componentReducer from './components-reducer'
import pageInfoReducer from './page-info-reducer'
import undoable, { excludeAction } from 'redux-undo'

export default configureStore({
  reducer: {
    user: userReducer,

    component: undoable(componentReducer, {
      limit: 20,
      filter: excludeAction([
        'component/resetComponents',
        'component/changeSelectedId',
        'component/selectNextComponent',
        'component/selectPrevComponent',
      ]),
    }),

    pageInfo: pageInfoReducer,
  },
})
